<?php
//Compiled by TIBlog Template Engine v2.0 , Created on : 2011-04-28 16:17:32
defined('IN_DTE') or exit('Access Denied');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<TITLE>注册 - 电影评论网</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<LINK href="/static/css/global.css" type=text/css rel=stylesheet>
<LINK href="/static/css/accounts.css" type=text/css rel=stylesheet>
<LINK rel=stylesheet type=text/css href="/static/css/packed_douban53.css">
<LINK rel=stylesheet type=text/css href="/static/css/packed__all12.css">

<script type="text/javascript" src="/static/js/jquery.min.js"></script>
</HEAD>
<BODY>
<div id=header>
	<div class="topbar">
		<div class="l"></div>
		<div class="r"><?php
echo $_obj['logintip'];
?>
</div>		
	</div>
	<div class=topper>
		<div class=logo><a href="/">电影评论网</a> <span>beta</span><br>movie.com</div>
		<div class=nav>
			<ul>
				<li><a href="/movie/coming">即将上映</a>  |</li>
				<li><a href="/movie/hot">最热</a>  |</li>
				<li><a href="/movie/popular">最多喜欢</a>  |</li>
				<li><a href="/<?php
echo $_obj['myspace'];
?>
">我的空间</a></li>
			</ul> 
		</div>
	</div>
	<div class=searchbar>
		<form method="get" action="/search/">
			<input type="text" class="ipt" name="keywords" value="电影名称、导演或演员" onblur="if(this.value=='') this.value='电影名称、导演或演员';" 
		onfocus="if(this.value=='电影名称、导演或演员') this.value='';" /><input type="submit" class="sbtn" value="" />
		</form>
	</div>
</div>
<script type="text/javascript" >
	var isEmail = false;
	function isWhiteWpace (s){
		var whitespace = " \t\n\r";
		var i;
		for (i = 0; i < s.length; i++){ 
			var c = s.charAt(i);
			if (whitespace.indexOf(c) >= 0) {return true;}
		}
		return false;
	}

	function isSsnString (ssn){
		var re=/^[0-9a-z][\w-.]*[0-9a-z]$/i;
		if(re.test(ssn)){return true;}else{return false;}
	}

	function checkUserName(str){
		$('#checkUserName').hide();
		$('#usernameResult').fadeOut();
		if( str.length<4 || str.length>18 ) {			
			setTimeout("finishAjax('usernameResult', '"+escape('用户名必须4-18位。')+"')", 200);
			return false;
		}
		if (isWhiteWpace(str)){
			setTimeout("finishAjax('usernameResult', '"+escape('用户名不能有空格。')+"')", 200);
			return false;
		}
		return true;
	}

	function is_email(str){
		var patton = /^(?:\w+[.-])*\w+@(?:\w+[.-])?\w+\.\w+(?:[.-]\w+){0,2}$/;
		if(!patton.exec(str)) {
			$('#emailResult').fadeOut();
			setTimeout("finishAjax('emailResult', '"+escape('邮件格式不正确。')+"')", 200);
			return false;
		}		
		return true;
	}

	function is_pwd(str){
		$('#pwdResult').fadeOut();
		if( str.length<6 || str.length>18 ) {			
			setTimeout("finishAjax('pwdResult', '"+escape('密码长度必须大于6位并小于18位。')+"')", 200);
			return false;
		}		
		if (isWhiteWpace(str)){
			setTimeout("finishAjax('pwdResult', '"+escape('您填写的密码格式不太正确。')+"')", 200);
			return false;
		}
		return true;
	}

	function chk_form(){
		if(checkUserName($('#username').val()) == false){
			$("#username").focus();
			return false;
		}
		if(is_email($('#email').val()) == false){
			$("#email").focus();
			return false;
		}
		if(is_pwd($('#password').val()) == false){
			$("#password").focus();
			return false;
		}
	}
	function finishAjax(id, response){
		$('#'+id).html(unescape(response));
		$('#'+id).fadeIn();
	}

	function checkUser (){
		if(!checkUserName($('#username').val())) {
			isUserName = false;
		} else {			
			$('#checkUserName').html('<img src="/static/images/loading.gif" />');
			$.post("/reg/check", {
				username: $('#username').val(),
				action: 'username'
			}, function(response){
				$('#usernameResult').hide();
				$('#checkUserName').fadeOut();
				if (response == 'no') {
					setTimeout("finishAjax('checkUserName', '"+escape('<img src="/static/images/false.gif" align="top" />')+"')", 200);
					$('#usernameResult').fadeOut();
					setTimeout("finishAjax('usernameResult', '"+escape('此用户名已注册。')+"')", 200);
				} else if(response == 'yes') {						
					setTimeout("finishAjax('checkUserName', '"+escape('<img src="/static/images/ture.gif" align="top" />')+"')", 200);
				}else{
					setTimeout("finishAjax('usernameResult', '"+escape(response)+"')", 200);
				}	
			});
			return false;
		}
	}


	function checkEmail (){
		if(!is_email($('#email').val())) {
			isEmail = false;
		} else {
			$('#checkEmail').html('<img src="/static/images/loading.gif" />');
			$.post("/reg/check", {
				email: $('#email').val(),
				action: 'email'
			}, function(response){
				$('#emailResult').hide();
				$('#checkEmail').fadeOut();
				if (response == 'no') {
					$('#emailResult').fadeOut();
					setTimeout("finishAjax('emailResult', '"+escape('此邮件地址已注册。')+"')", 200);
				} else if(response == 'yes') {						
					setTimeout("finishAjax('checkEmail', '"+escape('<img src="/static/images/ture.gif" align="top" />')+"')", 200);
				}else{
					setTimeout("finishAjax('emailResult', '"+escape(response)+"')", 200);
				}					
			});
			return false;		
		}
	}

	function checPwd (){
		if(!is_pwd($('#password').val())) {
			isPwd = false;
		} else {
			isPwd = true;
			return false;	
		}
	}
</script>
<DIV class="wrap">
	<DIV class="reg">
	<FORM method="post" action="" id="loginform" name="loginform" onsubmit="return chk_form();">
	<span style=" font-family:'\'cb\'ce\'cc\'e5'; color:#000000; font-size:21px;">欢迎加入电影评论网</span>

	<div class="accounts">
		<li><div><LABEL for="username">名号：</LABEL></div><input type="text" class="text" size="15" onblur="checkUser()" id="username" name="username" />
		<span id="checkUserName"></span><span id="usernameResult"></span></li>

		<li><div><LABEL for="email">邮箱：</LABEL></div><input type="text" class="text" size="15" onblur="checkEmail()" id="email" name="email" />
		<span id="checkEmail"></span><span id="emailResult"></span></li>

		<li><div><LABEL for="email">密码：</LABEL></div><input type="password" class="text" size="15" id="password" name="password" /></li>

		<li><div><LABEL for="email">验证码：</LABEL></div><img id="captchaimg" align="absmiddle" alt="..." src="/util/captcha/" style="margin-top:10px" onclick="document.getElementById('captchaimg').src = '/util/captcha/' + Math.random(); return false"/>
		<a tabindex="-1" href="#" title="刷新验证码" onclick="document.getElementById('captchaimg').src = '/util/captcha/' + Math.random(); return false">刷新验证码</a></li>
		<li><div>&nbsp;</div><input type="input" class="text" style="width:106px;" size="4" name="verifycode" /></li>
		<li><div>&nbsp;</div><input type="checkbox" id="remember" name="remember" tabindex="3"/><label for="remember" style="font-weight:normal"> 我已阅读本站注册协议</label></li>
		<li><div>&nbsp;</div><input type="submit" class="btn" value="注册" /></li>
	</div>

	<DIV class="is_member">
		已经拥有本站帐号？&nbsp;<A href="/login" style="color:red">直接登陆</A>
	</DIV>
</FORM>
	</DIV>
</DIV>
<DIV class=clear></DIV>
<DIV id="footer">
	<DIV class="left">
		&copy; 2010 Movie.com, All Rights Reserved.&nbsp;&nbsp;&nbsp;苏ICP没有备案号&nbsp;&nbsp;<BR>
		<SPAN><?php
echo $_obj['debuginfo'];
?>
</SPAN>
	</DIV>
	<DIV class="right">
		<A href="/about/aboutus">关于我们</A>
		<A href="/about/flinks">友情链接</A>
		<A href="/about/contact">联系及合作</A>
		<A href="/about/feedback">投诉与建议</A>
		<A href="/about/sitemap">站点地图</A>
		<A href="/about/sitemap">使用帮助</A>		 
	</DIV>
</DIV> 
</BODY></HTML>
